#![feature(stdsimd)]
pub mod sha1;
pub mod config;
pub mod chunking;
pub mod super_feature;

pub use sha1::*;
pub use config::*;
pub use chunking::*;
pub use super_feature::*;

extern "C" {
    pub static mut destor:Config;
}

#[allow(static_mut_ref)]
pub fn destor_acquire() -> &'static mut Config {
    unsafe { &mut destor }
}

pub fn destor_default_config() {
    destor_acquire()
        .config_chunk_max_size(65536)
        .config_chunk_min_size(2048)
        .config_chunk_avg_size(8192)
        .config_chunk_algorithm("fixed")
        .config_super_feature_subregion_num(12)
        .config_features_per_sf(4)
	    .config_enable_sort_features(false);
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn it_works() {
        destor_default_config();
        destor_acquire().chunk_algorithm_init();
        println!("{:#?}",destor_acquire());
        let what:MhSha1Ctx = MhSha1Ctx::new();
    }
}
